
class Student:
    """
    学生类
    """
    i = 12345
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def hello(self) -> str:
        return f"Hello {self.name}"

    def welcome(self, name: str) -> str:
        return f"welcome {name}"


# 输出 12345
print(Student.i)
# 输出 <function Student.hello at 0x1127c8180>
print(Student.hello)
# 不允许的操作
# print(Student.welcome("John"))

# 实例化
s = Student("Tom", 20)
print(s.name)   # 输出name值
print(s.hello())
print(s.welcome("John"))
# 下面方式等同于 s.welcome("John")
print(Student.welcome(s, "John"))
